using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

//@author A0090998H
namespace EZXPNS
{
    static class ExpenseCategory
    {
        private static List<string> _expenseItems;

        //Constructor
        static ExpenseCategory()
        {
            _expenseItems = new List<string>();
        }

        //Property for _expenseItems
        public static List<string> ExpenseItems
        {
            get { return _expenseItems; }
            set { _expenseItems = value; }
        }
        
        //Write working memory data to data storage-ExpenseCategory.txt file
        public static void UpdateCategory()
        {
            StreamWriter outputfile;
            outputfile = File.CreateText("../../ExpenseCategory.txt");

            for (int i = 0; i <ExpenseItems.Count; i++)
            {
                outputfile.WriteLine(ExpenseItems[i]);
            }

            outputfile.Close();
        }
    }
}
